<template>
  <div>
    <Form ref="formBox">
      <Input
        label="文本"
        :value="insuredInfo.userName"
        placeholder="请输入用户名字"
        :index="index"
        @input="addInsuredInfo({ userName: $event })"
      />
    </Form>
  </div>
</template>

<script>
import Form from "./form/Form.vue";
import Input from "./form/Input.vue";
export default {
  components: {
    Input,
    Form,
  },
  props: {
    insuredInfo: {
      type: Object,
      default: () => {},
    },
    index: [String, Number],
  },
  data() {
    return {};
  },
  methods: {
    async validate() {
      await this.$refs.formBox.validate();
    },
    addInsuredInfo(data) {
      Object.assign(this.insuredInfo, data);
    },
  },
};
</script>

<style scoped lang="less">
</style>
